package com.itheima;

import javax.swing.text.DateFormatter;
import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Test04 {
    public static void main(String[] args) {
        String time = "2021年04月11日11:47:40";
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日HH:mm:ss");

        LocalDateTime localDateTime = LocalDateTime.parse(time, dateTimeFormatter);
        System.out.println(localDateTime);
        int dayOfYear = localDateTime.getDayOfYear();
        DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();
        System.out.println("dayOfWeek = " + dayOfWeek);

    }
}
